home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
WebObjects
/
SourceCode
/
Scheduler
/
Main.wo
/
Main.wos
< prev
Wrap
Text File
|
1996-01-25
|
2KB
|
67 lines
/*
* Main.wos
* You may freely copy, distribute, and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to its
* fitness for any particular use.
*
* Written by Katie McCormick
*
*/
id date;
- awake
{
id now, dateString;
now = [NSCalendarDate date];
dateString = [now descriptionWithCalendarFormat:@"%B %d, %Y"];
// display the current date in the text field
if(!date)
date = dateString;
}
- computeMilestones {
id nextPage, finalDate, fcsDate, relDate, addendumDate, freezeDate;
fcsDate = [NSCalendarDate dateWithString:date calendarFormat:@"%B %d, %Y"];
// if that day is a Saturday, drop back to Friday
if ([fcsDate dayOfWeek] == 6)
fcsDate = [fcsDate addYear:0 month:0 day:-1 hour:0 minute:0 second:0];
// if that day is a Sunday, go ahead to Monday
if ([fcsDate dayOfWeek] == 0)
fcsDate = [fcsDate addYear:0 month:0 day:+1 hour:0
minute:0 second:0];
// final production
finalDate = [fcsDate addYear:0 month:0 day:-42 hour:0 minute:0 second:0];
// release notes
relDate = [fcsDate addYear:0 month:0 day:-49 hour:0 minute:0 second:0];
// freeze
freezeDate = [fcsDate addYear:0 month:0 day:-35 hour:0 minute:0 second:0];
// addendum
addendumDate = [fcsDate addYear:0 month:0 day:-28 hour:0
minute:0 second:0];
nextPage=[WOApp pageWithName:@"Dates"];
// change the format of the dates to include the day of the week
[nextPage setFcs:[fcsDate descriptionWithCalendarFormat:
@"%A, %B %d, %Y"]];
[nextPage setFinalProd:[finalDate descriptionWithCalendarFormat:
@"%A, %B %d, %Y"]];
[nextPage setRelNotes:[relDate descriptionWithCalendarFormat:
@"%A, %B %d, %Y"]];
[nextPage setFreeze:[freezeDate descriptionWithCalendarFormat:
@"%A, %B %d, %Y"]];
[nextPage setAddendum:[addendumDate descriptionWithCalendarFormat:
@"%A, %B %d, %Y"]];
return nextPage;
}